<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="/product/include/base_product_pre_part.jsp"></jsp:include>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/product.css" />
<script language="javascript" src="<%=request.getContextPath()%>/product/js/product_property_value.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function changeCategory(product_id){
	document.location ="<%=request.getContextPath()%>/product/editProduct.do?act=cate&id="+product_id;
}
var valueBox = new ValueBox("values");
$(document).ready(function(){valueBox.init();});
//-->
</script>
<a href="<%=request.getContextPath()%>/product/viewProduct.do?id=<s:property value="product.id" />">返回产品页面</a>
<jsp:include page="/include/actionErrors.jsp"></jsp:include>
<form action="<%=request.getContextPath()%>/product/saveProperty.do" method="post">
	<table width="100%">
		<s:hidden name="productId" value="%{product.id}" />
		<s:hidden name="property.id" />
		<s:hidden name="property.product.id" value="%{product.id}" />
		<s:label name="product.name" label="%{getText('name')}" />
		<tr>
			<td class="tdLabel">
				商品/服务参数:
			</td>
			<td>
				<input type="text" name="property.name" value="<s:property value="property.name" />" />
			</td>
		</tr>
		<tr>
			<td class="tdLabel">
				参数值范围:
			</td>
			<td>

				<span class="property"> <s:property value="name" /> </span>
				<ul id="values" style="list-style: decimal; margin-left: 20px;">
					<s:iterator value="property.values" status="status">
						<li>
							<span style="margin-right: 10px; cursor: pointer; display: inline;"><s:property value="value" /> </span>
							<label style="cursor: pointer; display: inline;">
								X
							</label>
							<input style="display: none;" name="values" value="<s:property value="value" />">
							<input style="display: none;" value="ok" type="button">
							<input style="display: none;" value="cancel" type="button">
						</li>


					</s:iterator>
				</ul>
				<a href="javascript:valueBox.add();">add</a>
			</td>
		</tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" value="提交" />
			</td>
		</tr>
	</table>
</form>
<jsp:include page="/product/include/base_product_last_part.jsp"></jsp:include>